<?
	session_start(); if (!$_SESSION['logged']) {header("Location: index.php"); die();}
//	echo "<pre>"; print_r ($_GET); echo "</pre>";
	include_once ('../core/adds.php');

	if (!empty($_POST['item_id'])) {
		file_put_contents("../user/sections/sect".$_POST['item_id'].".php",$_POST['editor1']);
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"[]>
<html lang="ru-RU">
<head>
<?	if (!empty($_POST['editor1'])) echo '<script>parent.$.fancybox.close();</script>';?>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Редактирование секций</title>
    <link rel="stylesheet" href="/core/reset.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="/adm/adm_style.css" type="text/css" media="screen" />
    <!--[if IE 6]><link rel="stylesheet" href="/core/style.ie6.css" type="text/css" media="screen" /><![endif]-->
    <!--[if IE 7]><link rel="stylesheet" href="/core/style.ie7.css" type="text/css" media="screen" /><![endif]-->
	<script type="text/javascript" src="/core/jquery.js"></script>
	<script type="text/javascript" src="/core/ckeditor/ckeditor.js"></script>
</head>
<body style="min-width: 500px;">
<form name="dd" action="edit_section.php" method="post">
<textarea id="editor1" name="editor1"><?=nvl(file_get_contents("../user/sections/sect".$_GET['section_id'].".php"),'содержимое секции')?></textarea>
<script type="text/javascript">
	CKEDITOR.replace('editor1');
</script>
<input name="item_id" type="hidden" value="<?=$_GET['section_id']?>">
</form>
</body>
</html>